package com.example.common.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.common.util.PageUtils;

import com.example.common.system.dao.RoleMenuDao;
import com.example.common.system.entity.RoleMenuEntity;
import com.example.common.system.service.RoleMenuService;


@Service("roleMenuService")
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuDao, RoleMenuEntity> implements RoleMenuService {

    @Override
    public PageUtils queryPage(Page<RoleMenuEntity> page, RoleMenuEntity roleMenuEntity) {
        IPage<RoleMenuEntity> result = this.page(page, new QueryWrapper<RoleMenuEntity>(roleMenuEntity));

        return new PageUtils(result.getRecords(),
                result.getTotal(),
                result.getSize(),
                result.getPages());
    }

}